package com.weiun.common.base.exception;

/**
 * 错误枚举列表
 *
 */
public enum ErrorMsgEnum {

    /**
     * 操作处理成功
     */
    SUCCESS(200, "Success"),

    /**
     * 错误请求，参数不完整
     */
    BadRequestException(400, "Bad request error"),

    /**
     * 用户已在其他设备登录  当前认证无效	   抛出 401
     */
    UnauthorizedException(401, "Unauthorized error"),

    /**
     * 账户 未登录  需要重新登录
     */
    NoAuthException(403, "No auth error"),

    /**
     * 权限不足
     */
    NoPermissionsException(403,"No permissions error"),


    /**
     * 请求超时
     */
    OvertimeException(408, "Timeout error"),

    /**
     * 操作异常，请稍候重试
     */
    ERROR(500, "Error");


    ErrorMsgEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private int code;

    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
